package tech.aistar.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.aistar.mapper.CartMapper;
import tech.aistar.pojo.Cart;

import java.util.List;

/**
 * 本来用来演示:
 *
 * @author success
 * @date 2025/3/5 09:00:02
 */
@Service
public class CartServiceImpl implements CartService{
    @Autowired
    private CartMapper cartMapper;
    @Override
    public List<Cart> listByUser(Integer userId) {
        return cartMapper.findByUser(userId);
    }

    @Override
    public int delCart(Integer cartId, Integer userId) {
        return cartMapper.delCart(cartId,userId);
    }

    @Override
    public List<Cart> findLikeName(String name, Integer userId) {
        return cartMapper.findLikeName(name,userId);
    }
}
